package com.zx.cloud.order.api.feign.fallback;

import com.zx.cloud.common.result.R;
import com.zx.cloud.order.api.feign.RemoteStockService;


import org.springframework.stereotype.Component;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

/**
 * @author zhaoxuan
 * @date 2020-11-06 09:21
 **/
@Component
@Slf4j
public class RemoteStockServiceFallbackFactory implements FallbackFactory<RemoteStockService> {

    @Override
    public RemoteStockService create(Throwable throwable) {

        log.error("库存服务调用失败:{}", throwable.getMessage());
        return null;
    }
}
